//
// Created by MikeChen on 2025/3/26.
//


#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main() {
    //printf函数格式 printf(格式控制,输出列表);
    //scanf函数格式 scanf(格式控制,地址列表);
    /*
    控制格式
        1.格式声明
            整型：
                int:%d(十进制) %o(八进制) %x(十六进制小写) %X(十六进制大写)
                unsigned int:%u
                short:%hd
                unsigned short:%hu
                long:%ld
                unsigned int:%lu
            浮点型：
                float:%f （单精度浮点型）
                double:%lf（双精度浮点型）
                %e（科学计数法）
                %i（自适应数据类型）
            字符和字符串
                字符：%c
                字符串：%s
        2.普通字符
            \n换行，逗号，\t制表格，空格
     */
//    int val1;
//    int val2;
//    int val3;

    //整型
    /*int val1 = 41404;
    int val2 = 0120674;
    int val3 = 0xa1bc;

//    scanf("%d",&val1);//41404
    printf("val1 = %d\n", val1);
    printf("val1 = %o\n", val1);
    printf("val1 = %x\n", val1);
    printf("val1 = %X\n\n", val1);

//    scanf("%o",&val2);//0120674
    printf("val2 = %d\n", val2);
    printf("val2 = %o\n", val2);
    printf("val2 = %x\n", val2);
    printf("val2 = %X\n\n", val2);

//    scanf("%x",&val3);//a1bc
    printf("val3 = %d\n", val3);
    printf("val3 = %o\n", val3);
    printf("val3 = %x\n", val3);
    printf("val3 = %X\n\n", val3);*/

    //浮点型
    /*float val4 = 3.415926927434;
    double val5 = 3.415926927434;
//    float val4;
//    double val5;

//    scanf("%f",&val4);//3.415926927434
    printf("val4 = %0.13f\n", val4);//val4 = 3.4159269332886
    printf("val4 = %0.13lf\n", val4);//val4 = 3.4159269332886
//    scanf("%lf",&val5);//3.415926927434
    printf("val5 = %0.13lf\n", val5);//val5 = 3.4159269274340

    printf("科学计数法：%e\t%e\n", -465.465e3, 7578.456465e5);//科学计数法：-4.654650e+05	7.578456e+08
    printf("双精度浮点数形式：%lf\t%lf\n", -465.465e3, 7578.456465e5);//双精度浮点数形式：-465465.000000	757845646.500000
*/

    //字符
    /*char val6;
    scanf("%c",&val6);//a 一次只能读一个字符
    printf("val6=%c\n",val6);//val6=a
    printf("val6=%d\n",val6);//val6=97*/

    //字符串
    /*char val7[127];//字符数组存储字符串
    scanf("%s",val7);
    printf("val7=%s\n",val7);*/

    /*
        scanf注意事项；
    */
    int val8,val9,val10;
    //按照指定格式输入才可以读取到数值
    //1.输入:val8=50,val9=60,val10=70
    //scanf("val8=%d,val9=%d,val10=%d",&val8,&val9,&val10);
    //2.输入:50,60,70
    //scanf("%d,%d,%d",&val8,&val9,&val10);
    //3.输入:50 60 70
    //scanf("%d %d %d",&val8,&val9,&val10);
    printf("val8=%d\nval9=%d\nval10=%d\n",val8,val9,val10);
    system("read -rsp $'Press enter to continue...\\n'");
    return EXIT_SUCCESS;
}